import request from "@/utils/request";

// 出库
export function produceApiOut(data) {
  return request({
    url: `/backAdmin/produceApi/out`,
    method: "post",
    data,
  });
}
// 订单出库列表
export function produceApiOutList(query) {
  return request({
    url: "/backAdmin/produceApi/out/list",
    method: "get",
    params: query,
  });
}

// 流程管理新增
export function addProcess(data) {
  return request({
    url: "/backAdmin/produceApi/process/add",
    method: "post",
    data,
  });
}


// 流程管理步骤列表
export function listProcessStep(produceProcessId) {
  return request({
    url: `/backAdmin/produceApi/process/step/list?produceProcessId=${produceProcessId}`,
    method: "get",
  });
}

// 流程管理列表
export function listProcess(query) {
  return request({
    url: "/backAdmin/produceApi/process/list",
    method: "get",
    params: query,
  });
}


// 删除流程
export function delProcess(produceProcessIdList) {
  return request({
    url: `/backAdmin/produceApi/process/delete?produceProcessIdList=${produceProcessIdList}`,
    method: "post",
  });
}


// 生产管理新增
export function addProduce(data) {
  return request({
    url: "/backAdmin/produceApi/produce/add",
    method: "post",
    data,
  });
}


// 生产质检步骤完成
export function listProduceStepFinish({ produceStepId , type }) {
  return request({
    url: `/backAdmin/produceApi/produce/step/finish?produceStepId=${produceStepId }&type=${type}`,
    method: "post",
  });
} 
// 入库打卡
export function produceStorageFinish(produceId) {
  return request({
    url: `/backAdmin/produceApi/produce/storage/finish?produceId=${produceId}`,
    method: "post",
  });
}


// 生产质检步骤详情
export function listProduceStep({ produceId, type }) {
  return request({
    url: `/backAdmin/produceApi/produce/step/list?produceId=${produceId}&type=${type}`,
    method: "get",
  });
}



// 生产管理列表
export function listProduce(query) {
  return request({
    url: "/backAdmin/produceApi/produce/list",
    method: "get",
    params: query,
  });
}
// 删除生产
export function delProduce(produceIdList) {
  return request({
    url: `/backAdmin/produceApi/produce/delete?produceIdList=${produceIdList}`,
    method: "post",
  });
}

// 物流发货列表未发货商品
export function produceApiSendProductList(orderId) {
  return request({
    url: `/backAdmin/produceApi/send/product/list?orderId=${orderId}`,
    method: "get",
  });
}
// 物流发货列表
export function produceApiSendList(query) {
  return request({
    url: `/backAdmin/produceApi/send/list`,
    method: "get",
    params: query,
  });
}
//  物流发货-发货
export function produceApiSend(data) {
  return request({
    url: `/backAdmin/produceApi/send`,
    method: "post",
    data,
  });
}

// 物流跟踪详情
export function produceApiTransportDetail(orderPackageId) {
  return request({
    url: `/backAdmin/produceApi/transport/detail?orderPackageId=${orderPackageId}`,
    method: "get",
  });
}


// 包裹详情
export function produceApiTransportPackageDetail(orderPackageId) {
  return request({
    url: `/backAdmin/produceApi/transport/package/detail?orderPackageId=${orderPackageId}`,
    method: "get",
  });
}


// 物流跟踪列表
export function listTransport(query) {
  return request({
    url: "/backAdmin/produceApi/transport/list",
    method: "get",
    params: query,
  });
}
//  物流跟踪删除
export function delTransport(orderPackageIdList) {
  return request({
    url: `/backAdmin/produceApi/transport/delete?orderPackageIdList=${orderPackageIdList}`,
    method: "post",
  });
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: "/system/notice/" + noticeId,
    method: "get",
  });
}
// 新增公告
export function addNotice(data) {
  return request({
    url: "/system/notice",
    method: "post",
    data: data,
  });
}
// 修改公告
export function updateNotice(data) {
  return request({
    url: "/system/notice",
    method: "put",
    data: data,
  });
}
// 删除公告
export function delNotice(noticeId) {
  return request({
    url: "/system/notice/" + noticeId,
    method: "delete",
  });
}


